home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / fastlane.arc / TESTIME3.ASM < prev    next >
Assembly Source File  |  1984-11-10  |  1KB  |  63 lines

  1.  
  2. data     segment  public byte
  3.  
  4. hextable db       '0123456789ABCDEF'
  5.  
  6. data     ends
  7.  
  8.  
  9. code     segment  public byte
  10.          assume   cs: code
  11.  
  12.  
  13.          public   calib
  14. calib    proc     near
  15.  
  16.          ; place the calibration code here
  17.          ret
  18.  
  19. calib    endp
  20.  
  21.  
  22.          public   test
  23. test     proc     near
  24.          assume   ds: data
  25.  
  26.          push     bx
  27.          push     cx
  28.          push     dx
  29.  
  30.          cld
  31.          mov      cl, 4
  32.          mov      dx, ax
  33.          mov      bx, offset hextable
  34.  
  35.          shr      ax, cl
  36.          and      ax, 0F0Fh            ; mask for first and third nibble
  37.          and      dx, 0F0Fh            ; mask for second and fourth nibble
  38.  
  39.          xchg     ah, al               ; upper nibble
  40.          xlat
  41.          stosb
  42.  
  43.          mov      al, dh               ; second nibble
  44.          xlat
  45.          stosb
  46.  
  47.          mov      al, ah               ; third nibble
  48.          xlat
  49.          stosb
  50.  
  51.          mov      al, dl               ; lower nibble
  52.          xlat
  53.          stosb
  54.  
  55.          pop      dx
  56.          pop      cx
  57.          pop      bx
  58.          ret
  59.  
  60. test     endp
  61.  
  62. code     ends
  63.          end